var htmlStr='<div id="banner" class="warp100"><ul class="warp1180" ><li class="left"><img src="images/logo_top.png" width="246" height="70" class="mt50"/>'
			+'</li><li class="right  mt70"> <div class="searchBox"><form action="" method="post"><input name="keyword" id="keyword" type="text" placeholder="请输入要搜索的关键字">'
	        +'<input  onclick="toSearchAll();" title="搜索信用滨州" id="searchBt" type="button" value=""></form></div></li></ul></div>'
			+'<div id="nav" class="warp100"><div class="warp1180"><ul id="navcont" ><li class="active"><a href="#">首页</a></li>'
			+'<li class="line"></li> <li><a href="#">协会介绍</a></li><li class="line"></li><li><a href="#">行业动态</a></li><li class="line"></li>'
			+'<li><a href="#">通知公告</a></li><li class="line"></li><li><a href="#">政策法规</a></li><li class="line"></li>'
			+'<li><a href="#">信用研究</a></li></ul> <!--<ul id="toptl" >-->'
			+'</ul></div></div> ';

var loginStr='<div id="toptl" >';


var loginbgStr ='<div id="login"><div  class="close"><img src="images/icon_close_tcgoodsshelf.png" width="30" height="31" onclick="MM_showHideLayers('+"'loginbg'"+','+"''"+','+"'hide'"+')" /></div>'
+'<div id="logo"><img src="images/logo_top.png" width="200" height="60" /></div><div id="usename">' 
+'<input name="" type="text" id="img"/></div><div id="password"><input name="" type="password" id="img2"/> '
+'</div><div id="remenber"><div id="botton" onclick="login();">登录</div></div>'
+'<div id="zhuce"> <span class="blue"><a href="#" class="left">忘记密码?</a> </span><span class="green"><a href="page_register.html?parent=90" > 立即注册!</a></span></div></div>';


$("#topId").append(htmlStr);
$("#loginbg").append(loginbgStr);

$("#loginbu").append(loginStr);
//获取url传递的参数
function getQueryString(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return unescape(r[2]); return null;
    }

var parent = getQueryString('parent');//父级菜单
var menu = getQueryString('menu');//当前菜单

if(parent==null || parent=='null'){
	parent=2;
}
var menuId = parent;//菜单栏颜色变化
querymenu();
//nowTime();
function querymenu(){
	$.ajax({
		  type: "post",
		  url: "../menu/queryMenuFromQian",
		  data: {
			  'parentId':1
			  },
		  dataType: "json",
		  success: function(data){
			  var str ='';
			  
			   $.each(data, function(index, entity){ 
				   str+='<li class='+(entity.id==menuId?"active":"")+'><a href="'+entity.qianUrl+'">'+entity.text+'</a></li>';
				   if(index+1!=data.length){
					   str+='<li class="line"></li>';
				   }
			    }
			   )
			   $("#navcont").html(str);
		  }
	  })
}


function toSearchAll(){
	var inputVal = $("#keyword").val().replace(/\s/g, "");
	if(inputVal==''){
		return;
	}
	var inputVal2 = encodeURI(inputVal);
	location.href='page_search_all.html?parent=0&inputVal='+inputVal2;
}

function nowTime(){
	/* 获取当前时间 */
		 var d = new Date(),str = '';
		 str += d.getFullYear()+'年';
		 str  += d.getMonth() + 1+'月';
		 str  += d.getDate()+'日';
		 var a = new Array("日", "一", "二", "三", "四", "五", "六"); 
		 var week = d.getDay(); 
		 str += " 星期"+ a[week];  
		 
		return str;
}